import { useLocation } from 'react-router-dom'
import Header from './components/Header'
import Info from './components/Info'
import TicketType from './components/TicketType'
import Passenger from './components/Passenger'
import ChooseSeat from './components/ChooseSeat'
import Footer from './components/Footer'
import styles from './css/ticket-order.module.css'

function TicketOrder() {
  // 获取路由的信息
  const location = useLocation()
  console.log(location.state)

  return (
    <div className={styles.box}>
      <Header />

      <Info {...location.state} />

      <TicketType />

      {/* 添加乘客的组件 */}
      <Passenger />

      {/* 选座组件 */}
      <ChooseSeat />

      <Footer {...location.state} />
    </div>
  )
}

export default TicketOrder
